The function KCUnlock unlocks a keychain. In most cases, your application does not need to call the function KCUnlock, since most Keychain Manager functions requiring an unlocked keychain call KCUnlock automatically. KCUnlock may display the Unlock dialog box if the keychain is currently locked. If your application needs to verify that a keychain is unlocked, call the function KCGetStatus.
You can call the function KCLock to lock an unlocked keychain. Your application should not call KCLock unless you are directly responding to a user's request to lock a keychain. In general, you should leave the keychain unlocked so that the user does not have to unlock it again in another application.